package flc.ast.adapter;


import android.view.View;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import flc.ast.bean.BgmBean;
import flc.ast.bean.FishBean;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;

public class BgmAdapter extends StkProviderMultiAdapter<BgmBean> {

    public BgmAdapter() {
        addItemProvider(new StkSingleSpanProvider(126));
        addItemProvider(new BgmProvider());
    }

    private class BgmProvider extends BaseItemProvider<BgmBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_bgm;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, BgmBean bean) {
            baseViewHolder.setText(R.id.tvBgmItemName, bean.getName());
            if (bean.isSelected()) {
                baseViewHolder.getView(R.id.ivBgmItemSel).setVisibility(View.VISIBLE);
            } else {
                baseViewHolder.getView(R.id.ivBgmItemSel).setVisibility(View.GONE);
            }
        }
    }

}
